"""
行为树黑板:
    行为树中,所有树节点共享的全局数据存储区，用于在树节点之间传递数据
"""

import py_trees

if __name__ == "__main__":
    blackboard = py_trees.blackboard.Client(name="Client")
    blackboard.register_key(key="foo", access=py_trees.common.Access.WRITE)
    blackboard.register_key(key="bar", access=py_trees.common.Access.READ)
    blackboard.foo = "foo"
    print(blackboard)
    print(blackboard.foo)

""" 输出:
Blackboard Client
  Client Data
    namespace         : /
    write             : {'/foo'}
    unique_identifier : e62f0a91-11f8-4363-958f-c0dc088d0dbb
    read              : {'/bar'}
    name              : Client
    exclusive         : set()
  Variables
    /foo : foo
    /bar : -

"""